package model

import (
	"github.com/astaxie/beego"
)

type PostValidateLabelReq struct {
	Id    int64  `json:"id"`
	Name  string `json:"name"`
	Color string `json:"color"`
}

type PostLabelAddReq struct {
	Value string `json:"value"`
	Color string `json:"color"`
}

type GetLabelListReq struct {
	PageSize    int64
	CurrentPage int64
}

func (getLabelListReq *GetLabelListReq) Validate(pageSize string, currentPage string, c *beego.Controller) bool {
	var err error
	getLabelListReq.PageSize, err = c.GetInt64(pageSize)
	if err != nil {
		return false
	}
	getLabelListReq.CurrentPage, err = c.GetInt64(currentPage)
	if err != nil {
		return false
	}
	return true
}

type PostLabelModifyReq struct {
	Id    int64  `json:"id"`
	Value string `json:"value"`
	Color string `json:"color"`
}

type DeleteLabelReq struct {
	Id []int64 `json:"id"`
}

type PostLabelTagReq struct {
	Data []LabelTag `json:"data"`
}

type LabelTag struct {
	StudentId int64   `json:"studentId"`
	LabelId   []int64 `json:"labelId"`
}
